import request from '@/utils/request'
import axios from '@/utils/request'

export function fetchList(params) {
    return request({
        url: '/api/front/blogInfo/page',
        method: 'get',
        params: params
    })
}

export function fetchFocus() {
    return request({
        url: '/api/front/focus/list',
        method: 'get',
        params: {}
    })
}

export function fetchCategory() {
    return request({
        url: '/api/front/blogCategory/list',
        method: 'get',
        params: {}
    })
}
export function fetchTags() {
    return request({
        url: '/api/front/blogTag/list',
        method: 'get',
        params: {}
    })
}

export function fetchFriend() {
    return request({
        url: '/api/front/friendLink/list',
        method: 'get',
        params: {}
    })
}

export function fetchSocial() {
    return request({
        url: '/social',
        method: 'get',
        params: {}
    });
}

export function fetchSiteInfo() {
    return request({
        url: '/api/front/site/info',
        method: 'get',
        params: {}
    })
}
export function fetchResources() {
    return request({
        url: '/resources',
        method: 'get',
        params: {}
    });
}

export function countComment(param) {
    return request({
        url: '/api/front/blogComment/count',
        method: 'get',
        params: param
    })
}

export function blogCommentDelete(param) {
    return request({
        url: '/api/front/blogComment/delete',
        method: 'get',
        params: param
    })
}
export function blogCommentAdd(param) {
    return axios({
        url: '/api/front/blogComment/add',
        method: 'post',
        data: param
    })
}

export function blogCommentPage(param) {
    return request({
        url: '/api/front/blogComment/page',
        method: 'get',
        params: param
    })
}
export function blogCommentTreePage(param) {
    return request({
        url: '/api/front/blogComment/treePage',
        method: 'get',
        params: param
    })
}

export function articleInfo(param) {
    return request({
        url: '/api/front/blogInfo' + param,
        method: 'get',
        params: {}
    })
}

export function view(param) {
    return request({
        url: '/api/front/blogInfo/view/' + param,
        method: 'get',
        params: {}
    })
}

export function reqCheck(param) {
    return request({
        url: '/api/captcha/check' ,
        method: 'post',
        data: param
    })
}

export function reqGet(param) {
    return request({
        url: '/api/captcha/get',
        method: 'post',
        data: param
    })
}
